package com.dhy.canal.util;


import org.springframework.core.convert.converter.Converter;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author 大忽悠
 * @create 2022/12/27 12:00
 */
public class CustomLocalDateTimeConvert implements Converter<String, LocalDateTime> {
    private final DateTimeFormatter dateTimeFormatter=DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

    @Override
    public LocalDateTime convert(String source) {
        return LocalDateTime.parse(source,dateTimeFormatter);
    }
}
